package com.gotcha.bootstart.model;

import com.fasterxml.jackson.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

/**
 * @time 2020/5/17
 * @auth Gotcha
 * @describe
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder

//@JsonPropertyOrder(value = {"title","author"}),改变json子元素排序
public class Article {
    //@JsonIgnore
    //排除属性，不做序列化操作
    private Long id;
    //@JsonProperty("authorrrr")
    //用来表示外部属性名字，就是使用别名序列化，而不是对象的名字
    private String author;
    private String title;
    private String content;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    //属性不为空才序列化(即,属性为空时,不传该属性)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    //指定属性格式
    private Date createTime;
    private List<Reader> reader;
}
